// pages/video/video.js
import request from '../../utils/request'
Page({

    /**
     * 页面的初始数据
     */
    data: {
        videoGroupList: [],
        navId: '',
        videoList: [],
        videoId: '', // 显示视频不是图片的标识
        videoTimeUpdate: [],
        isTriggered: false
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.getVideoGroupListData()
    },
    // 获取视频导航数据
    async getVideoGroupListData() {
        const result = await request('/video/group/list')
        if (result.code == 200) {
            this.setData({
                videoGroupList: result.data.slice(0, 14),
                navId: result.data[0].id
            })
            this.getVideoList(this.data.navId)
        }
    },
    // 切换导航
    changeNav(event) {
        let navId = event.currentTarget.id
        this.setData({
            navId,
            videoList: []
        })
        wx.showLoading({
            title: '加载中',
          })
        this.getVideoList(this.data.navId)
    },
    // 获取视频列表数据
    async getVideoList(navId) {
        let videoListData = await request('/video/group', {
            id: navId
        });
        wx.hideLoading()
        let index = 0
        let videoList = videoListData.datas.map(item => {
            item.id = index++;
            return item
        })
        // Url列表
        let videoUrlList = []
        // 获取Url
        for (let i = 0; i < videoList.length; i++) {
            let videoUrlItem = await request('/video/url', {
                id: videoList[i].data.vid
            })
            videoUrlList.push(videoUrlItem.urls[0].url)
        }
        // 将Url导入进videoList中
        for (let i = 0; i < videoUrlList.length; i++) {
            videoList[i].data.urlInfo = videoUrlList[i]
        }
        this.setData({
            videoList,
            isTriggered: false
        })
    },
    // 不要同时播放视频回调, =>以及展示图片还是video回调
    handlePlay(event) {
        let vid = event.currentTarget.id
        // this.vid !== vid && this.videoContext && this.videoContext.stop()
        // this.vid = vid
        // _展示video回调
        this.setData({
            videoId: vid
        })
        this.videoContext = wx.createVideoContext(vid)
        // 判断视频是否播放过
        let {videoTimeUpdate} = this.data
        let videoItem = videoTimeUpdate.find(item => item.vid === vid)
        if(videoItem) {
            let timepoint = videoItem.currentTime
            this.timer1 = setTimeout(() => {
                let videoContext1 = wx.createVideoContext(vid)
                videoContext1.seek(timepoint)
                videoContext1.play()
            }, 200)
        } else {
            this.timer2 = setTimeout(() => {
                let videoContext2 = wx.createVideoContext(vid)
                videoContext2.play()
            }, 200)
        }
        this.videoContext.play()
        // 如何找到上一个视频 关闭
        // 如何确认点击播放的视频和正在播放的视频不是同一个
    },
    // 记录播放进度
    handleTimeUpdate(event) {
        // console.log(event)
        let videoTimeObj = {vid: event.currentTarget.id, currentTime: event.detail.currentTime}
        // 判断是否有记录过，只需要最后的时间
        let {videoTimeUpdate} = this.data
        let videoItem = videoTimeUpdate.find(item => item.vid === videoTimeObj.vid)
        if(videoItem) {
            videoItem.currentTime = event.detail.currentTime
        }else {
            videoTimeUpdate.push(videoTimeObj)
        }
        this.setData({
            videoTimeUpdate
        })
    },
    // 视频播放结束回调
    handleEnded(event) {
        // 移除记录播放时长的当前视频对象
        let {videoTimeUpdate} = this.data
        videoTimeUpdate.splice(videoTimeUpdate.findIndex(item => item.vid === event.currentTarget.id), 1)
        this.setData({
            videoTimeUpdate
        })
    },
    // 下拉刷新
    handleRefresh() {
        // console.log('refresh')
        this.getVideoList(this.data.navId)
    },
    // 触底加载
    handleToLower() {
        console.log('low 请求，追加到数据列表里')
        // 模拟数据
        let newVideoList = [
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_8C5806D669B8D320BC0EB7682E962AAC",
                    "coverUrl": "https://p2.music.126.net/VyB0TD11pWIFTfeXJfbWRA==/109951163879322072.jpg",
                    "height": 1080,
                    "width": 1920,
                    "title": "法国小天后艾莉婕 （Alizee）：《La Isla Bonita》",
                    "description": "法国小天后艾莉婕 （Alizee）：《La Isla Bonita》",
                    "commentCount": 299,
                    "shareCount": 6069,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 30634253
                        },
                        {
                            "resolution": 480,
                            "size": 53290384
                        },
                        {
                            "resolution": 720,
                            "size": 81884879
                        },
                        {
                            "resolution": 1080,
                            "size": 111319848
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 510000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/7Xy4RXjukkM9uuDAVfliOQ==/109951164540423873.jpg",
                        "accountStatus": 0,
                        "gender": 1,
                        "city": 510100,
                        "birthday": 723052800000,
                        "userId": 16422771,
                        "userType": 207,
                        "nickname": "凌凌漆同学",
                        "signature": "不定期更新超清港乐视频和邓紫棋张靓颖音乐视频。欢迎关注，谢谢！ 微博：凌凌漆学长 B站：凌凌漆同学",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951164540423870,
                        "backgroundImgId": 109951163254618670,
                        "backgroundUrl": "http://p1.music.126.net/WngE-gOSwgM0lj8EGpUvfw==/109951163254618665.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": {
                            "1": "影视视频达人",
                            "2": "生活图文达人"
                        },
                        "djStatus": 10,
                        "vipType": 11,
                        "remarkName": null,
                        "avatarImgIdStr": "109951164540423873",
                        "backgroundImgIdStr": "109951163254618665"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 9102,
                            "name": "演唱会",
                            "alg": null
                        },
                        {
                            "id": 57106,
                            "name": "欧美现场",
                            "alg": null
                        },
                        {
                            "id": 57108,
                            "name": "流行现场",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 12100,
                            "name": "流行",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        },
                        {
                            "id": 13172,
                            "name": "欧美",
                            "alg": null
                        },
                        {
                            "id": 23116,
                            "name": "音乐推荐",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2327675546_bud6me0H.webp?wsSecret=fcc9e15ac94b1d41a09706f405c7c9fa&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [
                        {
                            "name": "La Isla Bonita",
                            "id": 2116937,
                            "pst": 0,
                            "t": 0,
                            "ar": [
                                {
                                    "id": 130638,
                                    "name": "Alizée",
                                    "tns": [],
                                    "alias": []
                                }
                            ],
                            "alia": [],
                            "pop": 90,
                            "st": 0,
                            "rt": "",
                            "fee": 8,
                            "v": 13,
                            "crbt": null,
                            "cf": "",
                            "al": {
                                "id": 213242,
                                "name": "Psychédélices",
                                "picUrl": "http://p4.music.126.net/wuOnehh16AJheXlQsOLwOQ==/1708641069565499.jpg",
                                "tns": [],
                                "pic": 1708641069565499
                            },
                            "dt": 222592,
                            "h": {
                                "br": 320000,
                                "fid": 0,
                                "size": 8905708,
                                "vd": -50398
                            },
                            "m": {
                                "br": 192000,
                                "fid": 0,
                                "size": 5343442,
                                "vd": -50398
                            },
                            "l": {
                                "br": 128000,
                                "fid": 0,
                                "size": 3562309,
                                "vd": -50398
                            },
                            "a": null,
                            "cd": "1",
                            "no": 12,
                            "rtUrl": null,
                            "ftype": 0,
                            "rtUrls": [],
                            "djId": 0,
                            "copyright": 1,
                            "s_id": 0,
                            "mst": 9,
                            "cp": 7001,
                            "mv": 263008,
                            "rtype": 0,
                            "rurl": null,
                            "publishTime": 1197302400007,
                            "privilege": {
                                "id": 2116937,
                                "fee": 8,
                                "payed": 0,
                                "st": 0,
                                "pl": 128000,
                                "dl": 0,
                                "sp": 7,
                                "cp": 1,
                                "subp": 1,
                                "cs": false,
                                "maxbr": 320000,
                                "fl": 128000,
                                "toast": false,
                                "flag": 256,
                                "preSell": false
                            }
                        }
                    ],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "8C5806D669B8D320BC0EB7682E962AAC",
                    "durationms": 224814,
                    "playTime": 749785,
                    "praisedCount": 7005,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_BA983C8103448E0A52C837D4D75D36A6",
                    "coverUrl": "https://p2.music.126.net/06FjgeC4qclPDNv4HqQZBQ==/109951163769339539.jpg",
                    "height": 720,
                    "width": 1280,
                    "title": "全程高能！再次感受惊艳世界的名曲！",
                    "description": "马克西姆《克罗地亚狂想曲》全程高能！再次感受惊艳世界的名曲！",
                    "commentCount": 325,
                    "shareCount": 1282,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 13019473
                        },
                        {
                            "resolution": 480,
                            "size": 20155386
                        },
                        {
                            "resolution": 720,
                            "size": 28360539
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 340000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/OqEkaKwFoV2XgsddPGfcow==/109951165474023172.jpg",
                        "accountStatus": 0,
                        "gender": 0,
                        "city": 340100,
                        "birthday": 631123200000,
                        "userId": 415197557,
                        "userType": 207,
                        "nickname": "全球音乐吧",
                        "signature": "vv：goback17s",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951165474023170,
                        "backgroundImgId": 109951166223106900,
                        "backgroundUrl": "http://p1.music.126.net/p1stKDNMdYwRKoEtTcQogQ==/109951166223106890.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": {
                            "1": "音乐视频达人",
                            "2": "欧美音乐资讯达人"
                        },
                        "djStatus": 10,
                        "vipType": 11,
                        "remarkName": null,
                        "avatarImgIdStr": "109951165474023172",
                        "backgroundImgIdStr": "109951166223106890"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 57106,
                            "name": "欧美现场",
                            "alg": null
                        },
                        {
                            "id": 57114,
                            "name": "钢琴演奏",
                            "alg": null
                        },
                        {
                            "id": 4103,
                            "name": "演奏",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        },
                        {
                            "id": 26117,
                            "name": "钢琴",
                            "alg": null
                        },
                        {
                            "id": 23128,
                            "name": "纯音乐",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2229166495_9Nr0ZmMH.webp?wsSecret=60123318a370b6cf9532425254e53578&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [
                        {
                            "name": "Croatian Rhapsody",
                            "id": 1696373,
                            "pst": 0,
                            "t": 0,
                            "ar": [
                                {
                                    "id": 38854,
                                    "name": "Maksim",
                                    "tns": [],
                                    "alias": []
                                }
                            ],
                            "alia": [],
                            "pop": 100,
                            "st": 0,
                            "rt": "600902000000798098",
                            "fee": 1,
                            "v": 105,
                            "crbt": null,
                            "cf": "",
                            "al": {
                                "id": 172115,
                                "name": "The Piano Player",
                                "picUrl": "http://p4.music.126.net/eNFhIgV8pF5zp5tRHSyyVg==/705886465073362.jpg",
                                "tns": [],
                                "pic": 705886465073362
                            },
                            "dt": 213813,
                            "h": {
                                "br": 320000,
                                "fid": 0,
                                "size": 8555668,
                                "vd": -14286
                            },
                            "m": {
                                "br": 192000,
                                "fid": 0,
                                "size": 5133418,
                                "vd": -11682
                            },
                            "l": {
                                "br": 128000,
                                "fid": 0,
                                "size": 3422293,
                                "vd": -9998
                            },
                            "a": null,
                            "cd": "1",
                            "no": 11,
                            "rtUrl": null,
                            "ftype": 0,
                            "rtUrls": [],
                            "djId": 0,
                            "copyright": 1,
                            "s_id": 0,
                            "mst": 9,
                            "cp": 14002,
                            "mv": 5364985,
                            "rtype": 0,
                            "rurl": null,
                            "publishTime": 1072108800007,
                            "tns": [
                                "克罗地亚狂想曲"
                            ],
                            "privilege": {
                                "id": 1696373,
                                "fee": 1,
                                "payed": 0,
                                "st": 0,
                                "pl": 0,
                                "dl": 0,
                                "sp": 0,
                                "cp": 0,
                                "subp": 0,
                                "cs": false,
                                "maxbr": 999000,
                                "fl": 0,
                                "toast": false,
                                "flag": 260,
                                "preSell": false
                            }
                        }
                    ],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "BA983C8103448E0A52C837D4D75D36A6",
                    "durationms": 210443,
                    "playTime": 586356,
                    "praisedCount": 4428,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_D2669D47F7011995AED7B88D058FD013",
                    "coverUrl": "https://p2.music.126.net/t0eSpeyX7dBI3pzKRTV4qw==/109951163725630341.jpg",
                    "height": 720,
                    "width": 1280,
                    "title": "崔子格 一首《卜卦》，听了那么多年，怎么听都不够！",
                    "description": "崔子格 一首《卜卦》，听了那么多年，怎么听都不够！",
                    "commentCount": 1257,
                    "shareCount": 3594,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 23063424
                        },
                        {
                            "resolution": 480,
                            "size": 39170623
                        },
                        {
                            "resolution": 720,
                            "size": 67630971
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 450000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/OvMvp3KTR215HKWOZ-jvcw==/109951163716272270.jpg",
                        "accountStatus": 0,
                        "gender": 0,
                        "city": 450100,
                        "birthday": 542390400000,
                        "userId": 1694861984,
                        "userType": 0,
                        "nickname": "丽枫玉玉",
                        "signature": "分享好音乐好音质的唯美歌曲",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951163716272270,
                        "backgroundImgId": 109951162868126480,
                        "backgroundUrl": "http://p1.music.126.net/_f8R60U9mZ42sSNvdPn2sQ==/109951162868126486.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": null,
                        "djStatus": 0,
                        "vipType": 0,
                        "remarkName": null,
                        "avatarImgIdStr": "109951163716272270",
                        "backgroundImgIdStr": "109951162868126486"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 9102,
                            "name": "演唱会",
                            "alg": null
                        },
                        {
                            "id": 59101,
                            "name": "华语现场",
                            "alg": null
                        },
                        {
                            "id": 57108,
                            "name": "流行现场",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        },
                        {
                            "id": 72116,
                            "name": "短片",
                            "alg": null
                        },
                        {
                            "id": 23116,
                            "name": "音乐推荐",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2186485187_3BugHRC2.webp?wsSecret=de7bd4dfbc0b7b15fd6f03f1cfce6ac1&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "D2669D47F7011995AED7B88D058FD013",
                    "durationms": 214994,
                    "playTime": 2703060,
                    "praisedCount": 14432,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_130DC7E2B188D7CC61F5EAF4A1EB51ED",
                    "coverUrl": "https://p2.music.126.net/UlQ2dMrlRq784JlA-C7G3Q==/109951163574212780.jpg",
                    "height": 1080,
                    "width": 1920,
                    "title": "当年她凭借这首歌轰动华语歌坛，赚足了无数人的眼泪！",
                    "description": "1998年她凭借这首歌轰动华语歌坛，伤感的旋律，赚足了无数人的眼泪！",
                    "commentCount": 360,
                    "shareCount": 989,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 36478197
                        },
                        {
                            "resolution": 480,
                            "size": 65132136
                        },
                        {
                            "resolution": 720,
                            "size": 96622055
                        },
                        {
                            "resolution": 1080,
                            "size": 172950641
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 340000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/C6VID_CReqmt8ETsUWaYTQ==/18499283139231828.jpg",
                        "accountStatus": 0,
                        "gender": 0,
                        "city": 340100,
                        "birthday": -2209017600000,
                        "userId": 479954154,
                        "userType": 207,
                        "nickname": "音乐诊疗室",
                        "signature": "当我坐在那架破旧古钢琴旁边的时候，我对最幸福的国王也不羡慕。（合作推广请私信，或者+V信：mjs927721）",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 18499283139231828,
                        "backgroundImgId": 1364493978647983,
                        "backgroundUrl": "http://p1.music.126.net/i4J_uvH-pb4sYMsh4fgQAA==/1364493978647983.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": {
                            "1": "音乐视频达人",
                            "2": "音乐资讯达人"
                        },
                        "djStatus": 0,
                        "vipType": 11,
                        "remarkName": null,
                        "avatarImgIdStr": "18499283139231828",
                        "backgroundImgIdStr": "1364493978647983"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 59101,
                            "name": "华语现场",
                            "alg": null
                        },
                        {
                            "id": 57108,
                            "name": "流行现场",
                            "alg": null
                        },
                        {
                            "id": 59108,
                            "name": "巡演现场",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_1906499905_Q5WlcYnl.webp?wsSecret=2f487bb10b4e0c90fe2a5280ed214c32&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [
                        {
                            "name": "相见恨晚",
                            "id": 280761,
                            "pst": 0,
                            "t": 0,
                            "ar": [
                                {
                                    "id": 9102,
                                    "name": "彭佳慧",
                                    "tns": [],
                                    "alias": []
                                }
                            ],
                            "alia": [],
                            "pop": 100,
                            "st": 0,
                            "rt": "600902000009572681",
                            "fee": 1,
                            "v": 46,
                            "crbt": null,
                            "cf": "",
                            "al": {
                                "id": 27909,
                                "name": "美声荣耀",
                                "picUrl": "http://p4.music.126.net/GpsgjHB_9XgtrBVXt8XX4w==/93458488373078.jpg",
                                "tns": [],
                                "pic": 93458488373078
                            },
                            "dt": 254760,
                            "h": {
                                "br": 320000,
                                "fid": 0,
                                "size": 10193023,
                                "vd": -38403
                            },
                            "m": {
                                "br": 192000,
                                "fid": 0,
                                "size": 6115831,
                                "vd": -35795
                            },
                            "l": {
                                "br": 128000,
                                "fid": 0,
                                "size": 4077235,
                                "vd": -34115
                            },
                            "a": null,
                            "cd": "1",
                            "no": 7,
                            "rtUrl": null,
                            "ftype": 0,
                            "rtUrls": [],
                            "djId": 0,
                            "copyright": 1,
                            "s_id": 0,
                            "mst": 9,
                            "cp": 7001,
                            "mv": 5403169,
                            "rtype": 0,
                            "rurl": null,
                            "publishTime": 1141142400000,
                            "privilege": {
                                "id": 280761,
                                "fee": 1,
                                "payed": 0,
                                "st": 0,
                                "pl": 0,
                                "dl": 0,
                                "sp": 0,
                                "cp": 0,
                                "subp": 0,
                                "cs": false,
                                "maxbr": 999000,
                                "fl": 0,
                                "toast": false,
                                "flag": 4,
                                "preSell": false
                            }
                        }
                    ],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "130DC7E2B188D7CC61F5EAF4A1EB51ED",
                    "durationms": 368246,
                    "playTime": 959516,
                    "praisedCount": 4678,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_B69FDCD2926265CEF8FCDE065F5A6124",
                    "coverUrl": "https://p2.music.126.net/AG8ijNJV4K-QcxgG-DtFLg==/109951163755374726.jpg",
                    "height": 1080,
                    "width": 1920,
                    "title": "现场版 超燃 'SOLO' + '뚜두뚜두(DDU-DU DDU-DU)",
                    "description": "现场版 超燃 'SOLO' + '뚜두뚜두(DDU-DU DDU-DU)",
                    "commentCount": 1134,
                    "shareCount": 1851,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 108410268
                        },
                        {
                            "resolution": 480,
                            "size": 184674098
                        },
                        {
                            "resolution": 720,
                            "size": 279528736
                        },
                        {
                            "resolution": 1080,
                            "size": 384827315
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 110000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/R7ufUH3WHTZp8Lts2W_NZw==/109951163072064506.jpg",
                        "accountStatus": 0,
                        "gender": 2,
                        "city": 110101,
                        "birthday": 946656000000,
                        "userId": 469563109,
                        "userType": 0,
                        "nickname": "红豆热影铺",
                        "signature": "经典、吐槽、拉郎拉娘配。",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951163072064510,
                        "backgroundImgId": 109951162910626850,
                        "backgroundUrl": "http://p1.music.126.net/WTMmqcYdKjFIyeZM9qkTTw==/109951162910626842.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": {
                            "1": "视频达人(二次元)"
                        },
                        "djStatus": 0,
                        "vipType": 0,
                        "remarkName": null,
                        "avatarImgIdStr": "109951163072064506",
                        "backgroundImgIdStr": "109951162910626842"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 1101,
                            "name": "舞蹈",
                            "alg": null
                        },
                        {
                            "id": 57107,
                            "name": "韩语现场",
                            "alg": null
                        },
                        {
                            "id": 57108,
                            "name": "流行现场",
                            "alg": null
                        },
                        {
                            "id": 59108,
                            "name": "巡演现场",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        },
                        {
                            "id": 92105,
                            "name": "BLACKPINK",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2220206600_cEIVTTTt.webp?wsSecret=a5104f5c53ff4e58ba7b579cea36482d&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": [
                        101
                    ],
                    "relateSong": [
                        {
                            "name": "DDU-DU DDU-DU",
                            "id": 1325896374,
                            "pst": 0,
                            "t": 0,
                            "ar": [
                                {
                                    "id": 12068017,
                                    "name": "BLACKPINK",
                                    "tns": [],
                                    "alias": []
                                }
                            ],
                            "alia": [],
                            "pop": 100,
                            "st": 0,
                            "rt": null,
                            "fee": 8,
                            "v": 25,
                            "crbt": null,
                            "cf": "",
                            "al": {
                                "id": 74266151,
                                "name": "BLACKPINK IN YOUR AREA",
                                "picUrl": "http://p4.music.126.net/yKysEblB7-HOVrUCjvRhqw==/109951163678530141.jpg",
                                "tns": [],
                                "pic_str": "109951163678530141",
                                "pic": 109951163678530140
                            },
                            "dt": 209493,
                            "h": {
                                "br": 320000,
                                "fid": 0,
                                "size": 8382215,
                                "vd": -64475
                            },
                            "m": {
                                "br": 192000,
                                "fid": 0,
                                "size": 5029346,
                                "vd": -64475
                            },
                            "l": {
                                "br": 128000,
                                "fid": 0,
                                "size": 3352912,
                                "vd": -64475
                            },
                            "a": null,
                            "cd": "1",
                            "no": 6,
                            "rtUrl": null,
                            "ftype": 0,
                            "rtUrls": [],
                            "djId": 0,
                            "copyright": 0,
                            "s_id": 0,
                            "mst": 9,
                            "cp": 457010,
                            "mv": 14541193,
                            "rtype": 0,
                            "rurl": null,
                            "publishTime": 1542902400000,
                            "privilege": {
                                "id": 1325896374,
                                "fee": 8,
                                "payed": 0,
                                "st": 0,
                                "pl": 128000,
                                "dl": 0,
                                "sp": 7,
                                "cp": 1,
                                "subp": 1,
                                "cs": false,
                                "maxbr": 999000,
                                "fl": 128000,
                                "toast": false,
                                "flag": 5,
                                "preSell": false
                            }
                        }
                    ],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "B69FDCD2926265CEF8FCDE065F5A6124",
                    "durationms": 463122,
                    "playTime": 2561078,
                    "praisedCount": 25405,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_15AED2B79603419CAA4C8CDCE796ACD2",
                    "coverUrl": "https://p2.music.126.net/LzgQ-1z6QZNSteY_tIxPAQ==/109951163676266635.jpg",
                    "height": 720,
                    "width": 1280,
                    "title": "直戳内心！外国好声音中那些最触动人心的演唱",
                    "description": "充沛的情感永远是演唱中打动人心的第一要素。无论是低吟浅唱，高亢嘹亮抑或是声嘶力竭，满含情感的演唱总是能瞬间直戳我们的心灵。一起来看看外国好声音中那些最触动人心的演唱吧",
                    "commentCount": 881,
                    "shareCount": 1583,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 156631550
                        },
                        {
                            "resolution": 480,
                            "size": 260859295
                        },
                        {
                            "resolution": 720,
                            "size": 367323199
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 310000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/N2aJTiONCaH1CeamZpURQQ==/109951163589830265.jpg",
                        "accountStatus": 0,
                        "gender": 0,
                        "city": 310101,
                        "birthday": 801072000000,
                        "userId": 271702583,
                        "userType": 200,
                        "nickname": "NeilShine_",
                        "signature": "我，音乐，世界",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951163589830270,
                        "backgroundImgId": 109951163258257120,
                        "backgroundUrl": "http://p1.music.126.net/S-F3QRXtgNQRmwabS9gdew==/109951163258257115.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": [
                            "欧美"
                        ],
                        "experts": null,
                        "djStatus": 0,
                        "vipType": 10,
                        "remarkName": null,
                        "avatarImgIdStr": "109951163589830265",
                        "backgroundImgIdStr": "109951163258257115"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 57106,
                            "name": "欧美现场",
                            "alg": null
                        },
                        {
                            "id": 57108,
                            "name": "流行现场",
                            "alg": null
                        },
                        {
                            "id": 59108,
                            "name": "巡演现场",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2131210046_cKJGSk8W.webp?wsSecret=0aeb640df4547a3763a5e71f2d2674ff&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "15AED2B79603419CAA4C8CDCE796ACD2",
                    "durationms": 1765142,
                    "playTime": 1806480,
                    "praisedCount": 10477,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_06C637EB0D5705FC8416DED8FA087E5A",
                    "coverUrl": "https://p2.music.126.net/GLFFz1mzJXtli1AAMxkl9A==/109951163852300990.jpg",
                    "height": 720,
                    "width": 1280,
                    "title": "TFBOYS演唱歌曲《Heart》,满满的回忆！",
                    "description": " TFBOYS演唱歌曲《Heart》,满满的回忆！",
                    "commentCount": 677,
                    "shareCount": 1661,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 26656187
                        },
                        {
                            "resolution": 480,
                            "size": 44398918
                        },
                        {
                            "resolution": 720,
                            "size": 63081781
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 110000,
                        "authStatus": 1,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/IQqv5IfJsNCG1GGbKxSJ0Q==/109951167090780307.jpg",
                        "accountStatus": 0,
                        "gender": 1,
                        "city": 110101,
                        "birthday": 965812041369,
                        "userId": 555304231,
                        "userType": 207,
                        "nickname": "娱玖爷",
                        "signature": "娱玖爷，明星八卦！娱乐圈精选优秀资源！好音乐分享！【微博同名】中华小曲库就是我！•_•. 商演合作，新专辑推广请私信！",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951167090780300,
                        "backgroundImgId": 109951165395722990,
                        "backgroundUrl": "http://p1.music.126.net/LulOmlCSpzNQKI9xmJYIcg==/109951165395722990.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": {
                            "1": "音乐视频达人",
                            "2": "生活图文达人"
                        },
                        "djStatus": 10,
                        "vipType": 11,
                        "remarkName": null,
                        "avatarImgIdStr": "109951167090780307",
                        "backgroundImgIdStr": "109951165395722990"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 11137,
                            "name": "TFBOYS",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        },
                        {
                            "id": 4101,
                            "name": "娱乐",
                            "alg": null
                        },
                        {
                            "id": 3101,
                            "name": "综艺",
                            "alg": null
                        },
                        {
                            "id": 76108,
                            "name": "综艺片段",
                            "alg": null
                        },
                        {
                            "id": 77102,
                            "name": "内地综艺",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_2303074288_ysXMR3Mt.webp?wsSecret=22b9af68270aa176f563defa4472e146&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "06C637EB0D5705FC8416DED8FA087E5A",
                    "durationms": 152138,
                    "playTime": 1573604,
                    "praisedCount": 18072,
                    "praised": false,
                    "subscribed": false
                }
            },
            {
                "type": 1,
                "displayed": false,
                "alg": "onlineHotGroup",
                "extAlg": null,
                "data": {
                    "alg": "onlineHotGroup",
                    "scm": "1.music-video-timeline.video_timeline.video.181017.-295043608",
                    "threadId": "R_VI_62_8936902D49A652F0D76FA862A31A025D",
                    "coverUrl": "https://p2.music.126.net/uuOopnL59wlc8EElhETi-w==/109951165153372467.jpg",
                    "height": 1080,
                    "width": 1920,
                    "title": "张艺兴 - 莲 Lit（第27届东方风云榜音乐盛典 Live版）1080P",
                    "description": "张艺兴 - 莲 Lit（第27届东方风云榜音乐盛典 Live版）2020/07/19 1080P\r\n\n投稿材料：\n1：超清画质以上（可包含）的视频 \n2：视频的原链接 \n3：视频标题（艺人/歌曲名/节目名/是否为Live版） \n4：视频封面（选填） \n\n投稿邮箱：ly-to@foxmail.com",
                    "commentCount": 468,
                    "shareCount": 571,
                    "resolutions": [
                        {
                            "resolution": 240,
                            "size": 24027822
                        },
                        {
                            "resolution": 480,
                            "size": 41976353
                        },
                        {
                            "resolution": 720,
                            "size": 63087276
                        },
                        {
                            "resolution": 1080,
                            "size": 94560386
                        }
                    ],
                    "creator": {
                        "defaultAvatar": false,
                        "province": 460000,
                        "authStatus": 0,
                        "followed": false,
                        "avatarUrl": "http://p1.music.126.net/4vOGIEMQNJPkDX8I-Lg-NA==/109951165108395413.jpg",
                        "accountStatus": 0,
                        "gender": 1,
                        "city": 460100,
                        "birthday": 916070400000,
                        "userId": 449157773,
                        "userType": 207,
                        "nickname": "LY-TO",
                        "signature": "私人号，不是站子。\n持续更新优质舞台，转赞评加热度哦！\n专注自家即可，记得关注我哦！\n其他艺人舞台也可更新，接受粉丝视频投稿！\n\n投稿材料：\n1：超清画质以上（可包含）的视频\n2：视频的原链接\n3：视频标题（艺人/歌曲名/节目名/是否为Live版）\n4：视频发生日期（年/月/日）\n5：视频封面（选填）\n\n投稿邮箱：ly-to@foxmail.com\n⁠",
                        "description": "",
                        "detailDescription": "",
                        "avatarImgId": 109951165108395410,
                        "backgroundImgId": 109951163885412640,
                        "backgroundUrl": "http://p1.music.126.net/9k73nsZ09YzW8_7EUGZPcA==/109951163885412633.jpg",
                        "authority": 0,
                        "mutual": false,
                        "expertTags": null,
                        "experts": null,
                        "djStatus": 0,
                        "vipType": 11,
                        "remarkName": null,
                        "avatarImgIdStr": "109951165108395413",
                        "backgroundImgIdStr": "109951163885412633"
                    },
                    "urlInfo": null,
                    "videoGroup": [
                        {
                            "id": 58100,
                            "name": "现场",
                            "alg": null
                        },
                        {
                            "id": 59101,
                            "name": "华语现场",
                            "alg": null
                        },
                        {
                            "id": 59108,
                            "name": "巡演现场",
                            "alg": null
                        },
                        {
                            "id": 1100,
                            "name": "音乐现场",
                            "alg": null
                        },
                        {
                            "id": 5100,
                            "name": "音乐",
                            "alg": null
                        },
                        {
                            "id": 26135,
                            "name": "张艺兴",
                            "alg": null
                        },
                        {
                            "id": 23116,
                            "name": "音乐推荐",
                            "alg": null
                        }
                    ],
                    "previewUrl": "http://vodkgeyttp9.vod.126.net/vodkgeyttp8/preview_3063457096_a1Ic5hKi.webp?wsSecret=6231960587d666d585b4e4205dc505f5&wsTime=1673765214",
                    "previewDurationms": 4000,
                    "hasRelatedGameAd": false,
                    "markTypes": null,
                    "relateSong": [],
                    "relatedInfo": null,
                    "videoUserLiveInfo": null,
                    "vid": "8936902D49A652F0D76FA862A31A025D",
                    "durationms": 177066,
                    "playTime": 768474,
                    "praisedCount": 8256,
                    "praised": false,
                    "subscribed": false
                }
            }
        ];
        let videoList = this.data.videoList
        videoList.push(...newVideoList)
        this.setData({
            videoList
        })
    },
    // 跳转search
    toSearch() {
        wx.navigateTo({
          url: '/pages/search/search',
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {
        console.log('页面下拉刷新')
    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function ({from}) {
        console.log(from)
    }
})